
export interface VideoInfo {
  frameRate: number
  framesUrl: string
  imageHeight: number
  imageWidth: number
  totalFrame: number
}

export interface VideoItem {
  seriesUid: string,
  sarId: string,
  isActive: boolean,
  images: string[],
  frameRate: number
  imageHeight: number
  imageWidth: number
  totalFrame: number
}

export interface RectangModelPoint {
  x: number
  y: number
  z: number    //当前帧
  active?: boolean
  highlight?: boolean
  moving?: boolean
}
//矩形
export interface RectangModel {
  point1: RectangModelPoint
  point2: RectangModelPoint
  // textBox: any
  // cachedStats: any
  uuid?: string
}

export interface FreehandModelItem {
  x: number
  y: number
}
//自由画笔
export interface FreehandModel {
  vertices: FreehandModelItem[]
  version: number
  z: number
  uuid: string
}

export interface SeriesForm {
  required: boolean,
  field: string,
  label: string,
  message: string,
  type:string,
  value: string | string[] | undefined,
}

export interface NidusThirdItem {
  labelIndex: number,      //标注帧
  nidusName: string,
  name: string,                   
  toolName: string,               //标注工具
  data: RectangModel | any,             //标注数据
  id: string | number,            
  uuid: string,         
  resultGroupUuid: string | number,   //标注帧组的id
  hide: boolean                       //是否隐藏
  isActive: boolean,
  color: string,
  toolCode?: string,//工具编码lesion
  imageAnnotationId?: string | number | null       //
  imageAnnotationToolId?: string | number | null   //工具id
  imageAnnoForm?: SeriesForm[],
  alg: boolean
}

export interface NidusSubItem {
  id: string | number,
  name: string,
  startIndex: number | null,            //帧组的开始帧
  endIndex: number | null,              //帧组的结束帧
  child: NidusThirdItem[],          //帧组下的所有标注病灶
  slideValues: number[],                //开始帧和结束帧在ui上的显示值
  uuid: string,         
  isOpen: boolean,     
  hide: boolean,     
  isActive: boolean,
  algProcessed: boolean,  //帧段是否跑过追踪
}

export interface NidusItem {
  id: string | number,
  sarId: string | number,
  child: NidusSubItem[],
  seriesForm: SeriesForm[],
  currentVideoIndex: number,     //当前帧
  hide: boolean
}





// api export interface
export interface VideoFrameInfoModel {
  seriesUid: string
}
type ReateIarGroupModelType = "VIDEO_FRAME_SEGMENT";

export interface ReateIarGroupModel {
  arId: number | string,
  type: ReateIarGroupModelType,
  info: string,
}

export interface IdModel {
  id: number | string
}




//矩形
export interface RectangleModel {
  point1: RectangleModelPoint
  point2: RectangleModelPoint
}
export interface RectangleModelPoint {
  x: number,
  y: number,
  highlight: boolean,
  active: boolean,
  z: number
}


//创建病灶
export interface AnnoCreateModel {
  // imageAnnotationId: number | string
  // imageAnnotationToolId: number | string
  // seriesAnnotationResultId: string | number
  // resultGroupUuid: string | number
  // result: string | RectangleModel | any
  arId: number
  lesion: string
  tool: string
  result: string
  color?: string
  groupId?: number
}

//编辑病灶
export interface AnnoUpdateModel {
  alrId: number | string | null
  imageAnnotationToolId?: number | string | null
  result: string | RectangleModel | any
  color?: string
}




export interface annotationItemResultListItem {
	annotationItemId: string | number
	formComponentId: string | number
	result: string
}

//小征象
export interface imageResultEditModel {
	annotationItemResultList: annotationItemResultListItem
	id: number | string
}
//大征象
export interface seriesResultEditModel {
  annotationItemResultList: annotationItemResultListItem
	sarIdList: string
}


export interface ToolItemLabelListItem {
  name: string,
  type: string,
  color: string,
  id: string | number,
  annotationItemList: any[],
  imageAnnotationToolId: string | number,
  imageAnnotationId: string | number,
}

export interface ToolItem {
  name: string,       
  toolName: string,
  iconName: string,
  value: string,
  active: boolean,
  isSeleted?: boolean,
  type?: string,
  labelList?: ToolItemLabelListItem[],
  disabled: boolean
}

export type CommonRes = {
  code: number;
}

export type DiscardParams = {
  sarIdList: string;
  discardCode: string;
  discardReason: string;
}

export type DiscardList = {
  list: ListItem[];
} & CommonRes;

export type ListItem = {
  id: number;
  parentId: number;
  name: string;
  value: string;
  sequence: number;
  remark: string | null;
  type: string | null;
  createTime: Date;
  updateTime: Date;
}

export type YayParams = {
  sarIdList: string;
  yayAttributes: number;
}
// export {
//   NidusList,
//   NidusListItem,
//   NidusListItemChild,

//   VideoFrameInfoModel,
//   ReateIarGroupModel,
//   ReateIarGroupModelType,
//   IdModel,
// }

export type SeriesParams = {
  page: number;
  pageSize: number;
  reset: boolean;
  serialNumber: string;
  taskId: number;
  userId: number;
}

export type SeriesList = {
  list: SeriesItem[];
  pages: number;
  total: number;
  userDiscardedNum: number;
  userInProgressNum: number;
  userSubmitSeriesTotalNum: number;
};

export type SeriesItem = {
  algVersionId: null;
  annoLastUpdateTime: null;
  annoUpdateStatus: null;
  auditId: null;
  auditStatus: null;
  discardCode: string;
  discarded: boolean;
  discardReason: string;
  discardUserId: null;
  id: number;
  imageAnnoNum: number;
  imageTotalNum: number;
  projectId: null;
  serialNumber: string;
  status: number;
  submitTime: number;
  taskId: number;
  userId: number;
}